<?php
require_once ('Query.php');

class Newsitem extends Query {
	private $m_iNewsid;
	private $m_sTitle;
	private $m_sPublishdate;
	private $m_sAuthor;
	private $m_sContent;
	private $m_sSource;
	
	
	public function __construct()
	{
		$this->setTable('News');
	}
	
	
	/* Set the primairy key in the query
	 *
	 * @param unknown_type $p_iId
	 */
	public function setByParentId($p_iId) {
		$this->setPrimairyKey($p_iId);
		$this->m_iNewsid = $this->get('id');
		$this->m_sTitle = $this->get('titel');
		$this->m_sPublishdate = $this->get('date');
		$this->m_sAuthor = $this->get('author');
		$this->m_sContent = $this->get('content');
		$this->m_sSource = $this->get('link');
	}
	
	/**
	 * get id of the newsitem
	 *
	 * @return unknown
	 */
	public function getId() {
		return $this->m_iNewsid;
	}
	
	public function getTitle() {
		return $this->m_sTitle;
	}
	
	public function getDate() {
		return $this->m_sPublishdate;
	}
	
	public function getAuthor() {
		return $this->m_sAuthor;
	}
	
	public function getContent() {
		return $this->m_sContent;
	}
	
	public function getSource() {
		return $this->m_sSource;
	}
	
	public function setTitle($p_sTitle) {
		$this->m_sTitle = $p_sTitle;
		return $this->set('titel',$p_sTitle);
	}
	
	public function setDate($p_sDate) {
		$this->m_sPublishdate = $p_sDate;
		$this->set('date',$p_sDate);
	}
	
	public function setAuthor($p_sAutor) {
		$this->m_sAuthor = $p_sAutor;
		$this->set('author',$p_sAutor);
	}
	
	public function setContent($p_sContent) {
		$this->m_sContent = $p_sContent;
		$this->set('content',$p_sContent);
	}
	
	public function setSource($p_sSource) {
		$this->m_sSource = $p_sSource;
		$this->set('link',$p_sSource);
	}
}
?>